package edu.umbc.bluebarracudas;

import java.awt.Point;

public class Point3D extends Point {
	public int z;
	
	public Point3D(int newX, int newY, int newZ) {
		super(newX,newY);
		this.z = newZ;	
	}
	
	public Point3D() {
		super();
	}
	
	public Point3D clone() {
		return new Point3D(this.x, this.y, this.z);
	}
	
	public double getZ() {
		return this.z;
	}
	
	public void move(int newX, int newY, int newZ) {
		super.move(newX, newY);
		this.z = newZ;
	}
	
	public void translate(int dx, int dy, int dz) {
		this.z += dz;
		super.translate(dx, dy);
	}
	
	public double distance(Point3D coord2) {
		double distance = 0;
		double b = 2;
		distance = Math.pow((this.getX() - coord2.getX()), b) +
				   Math.pow((this.getY() - coord2.getY()), b) +
				   Math.pow((this.getZ() - coord2.getZ()), b);
		
		distance = Math.sqrt(distance);
		return distance;
	}
	
	
	public double distance(Point3D coord1, Point3D coord2) {
		double distance = 0;
		double b = 2;
		distance = Math.pow((coord1.getX() - coord2.getX()), b) +
				   Math.pow((coord1.getY() - coord2.getY()), b) +
				   Math.pow((coord1.getZ() - coord2.getZ()), b);
		
		distance = Math.sqrt(distance);
		return distance;
	}
	
	public double distance(double x1, double y1, double z1, 
						   double x2, double y2, double z2
	) {
		double distance = 0;
		double b = 2;
		distance = Math.pow((x1 - x2), b) +
				   Math.pow((y1 - y2), b) +
				   Math.pow((z1 - z2), b);
		
		distance = Math.sqrt(distance);
		return distance;
	}
	
	public double distance(double x2, double y2, double z2) {
		double distance = 0;
		double b = 2;
		distance = Math.pow((this.getX() - x2), b) +
		           Math.pow((this.getY() - y2), b) +
	               Math.pow((this.getZ() - z2), b);

       distance = Math.sqrt(distance);
      return distance;
     }
}
